{extend name="base" /}
{block name="seo"}
<title>{$item.seo_title} - {$item.category} - {$site.name}</title>
<meta name="keywords" content="{$item.keywords|default=$site.keywords}">
<meta name="description" content="{$item.description|default=$site.description}">
{/block}
{block name="css"}

<link href="__HOME__/css/article.css" rel="stylesheet" type="text/css">
<link href="__COMMON__/css/jquery.fancybox.min.css" rel="stylesheet" type="text/css">
<link href="__HOME__/css/comment.css" rel="stylesheet" type="text/css">
<link rel="stylesheet"
      href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/styles/vs2015.min.css">

<style>
    table{
        width: 100%;
        font-size: 12px;
        margin: 5px auto;
    }
    tbody tr:nth-child(odd) {
        background-color: #f0f0f0;
    }

    table td {
        line-height: 1.9;
        border-color: transparent;
        border-bottom: solid 1px #ddd;
        border-right: solid 1px #ddd;
        padding: 3px 5px;
        min-height: 30px;
    }
    .article-body ul {
        list-style: disc;
    }
    .article-body  ul li {
        margin: 10px;
    list-style-type:initial;
    }
    pre{
        font-size: 11px;
    max-height:300px;overflow-y:auto
    }

    .video {
        position: relative;
        padding-bottom: 56.25%;
        height: 0;
        overflow: hidden;
    }
    .video iframe,
    .video object,
    .video embed {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
</style>
{/block}
{block name="body"}
<div class="container">
    <div class="article-main layui-clear">
        <div class="left">
            <div class="layui-breadcrumb article-crumbs" style="visibility: visible;">当前位置：{$nowWhere|raw}</div>
            <div class="article-tit">
                <h1>
                   {$item.title}
                </h1>
                <div class="info">

                    <span>时间：{$item.publish_time}</span>
                    {if sysconfig('article.show_comments') eq 1}<span style="margin-left:10px;float: right"> 评论：<font class="comment-count" id="commentNum"></font></span>{/if}
                    {if sysconfig('article.show_views') eq 1}<span style="float: right"> 围观：<font class="comment-count" id="viewNum"></font></span>{/if}

                </div>
            </div>
            <div class="article-body">
                <article>
                    {$item.content|html_entity_decode|raw}
                </article>
            </div>

            {:hooks('attachlink.link_show',array('subject_id'=>$item.article_id,'subject'=>'ARTICLE'))}

            <div class="copyright">
                <p>
                    {:sysconfig('article.copyright_notice')}
                </p>
            </div>

            <div class="article-foot layui-clear">
                <a href="javascript:;" class="collect" data-id="{$item.id}"><i class="fa fa-star"></i>收藏</a>
                <a href="javascript:;" class="j-mobile-share" data-img="{$item.cover_img}" data-title="{$item.title}" data-desc="{$item.description}" data-uri="{$_SERVER['REQUEST_URI']}" title="生成海报"><i class="fa fa-paper-plane"></i>生成海报</a>
                {if sysconfig('article.show_praises') eq 1}<span id="newdigg"><a href="javascript:;" data-subject="ARTICLE" data-zan="zan" data-id="{$item.article_id}" class="zan"><i class="fa fa-thumbs-up"></i>点赞(<b id="zan"></b>)</a></span>{/if}
            </div>
            <div class="article-tags layui-clear">
                <?php $tags=explode(',',$item['keywords']);?>
                {volist name="tags" id="vo"}
                <a href="/tag/{$vo}.html" rel="tag" target="_blank"># {$vo}</a>
                {/volist}
            </div>
            <div class="article-page layui-clear">
                {if $lift['prev']}
                <?php $prev=$lift['prev'];?>
                <a href="{$prev.url}" class="up" style="background-image: url({$prev.cover_img});">
                    <div class="meta">
                        <div class="fl">
                            <i class="layui-icon layui-icon-left"></i><span>上一篇</span>
                        </div>
                        <div class="fr">
                            <span>{$prev.publish_time|substr=0,10}</span>
                        </div>
                    </div>
                    <h3>{$prev.title}</h3>
                </a>
                {/if}
                {if $lift['next']}
                <?php $next=$lift['next'];?>
                <a href="{$next.url}" class="down" style="background-image: url({$next.cover_img});">
                    <div class="meta">
                        <div class="fl">
                            <i class="layui-icon layui-icon-right"></i><span>下一篇</span>
                        </div>
                        <div class="fr">
                            <span>{$next.publish_time|substr=0,10}</span>
                        </div>
                    </div>
                    <h3>{$next.title}</h3>
                </a>
                {/if}
            </div>
            {if sysconfig('switch.comment')}
           <div class="article-pinglun">
                <div class="title">
                    评论留言
                </div>
                <div id="comments" class="entry-comments">
                    <div class="qy-comment">
                        <div class="qy-comment-box">
<!--                            <img class="b-head-img" src="__STATIC__/common/images/avatars/default.gif">-->
                            <div class="b-box-textarea">
                                <div class="b-box-textarea-body">
                                    <textarea class="b-box-content wdl" contenteditable="true" placeholder="说点什么吧"></textarea>
                                    <ul class="b-emote-submit">
                                        <li class="b-emote">
                                            <a class="ds-toolbar-button layui-icon layui-icon-face-smile-fine cr" title="插入表情"></a>
                                            <input class="b-email" onkeyup="getQQInfo(this)" type="text" name="email" data-type="QQ号" placeholder="你的QQ号" value="" style="display: none;">
                                            <div class="b-tuzki"></div>
                                            <div class="code"><input type="text" maxlength="4" value="" placeholder="请输入验证码" class="input-val"> <canvas id="canvas" width="100" height="29"></canvas></div>
                                        </li>
                                        <li class="b-submit-button">
                                            <input type="button" value="评 论" aid="{$item.article_id}" pid="0" class="btn sendpl" style="background-color: #007bf5;">
                                        </li>
                                        <li class="b-clear-float"></li>
                                    </ul>
                                </div>
                                <div class="error-tip" id="msgBox"></div>
                                <div id="progressOuter" class="progress progress-striped active" style="display: none">
                                    <div id="progressBar" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
                                    </div>
                                </div>
                                <div class="qy-img-list"></div>
                                <div id="qy-upload-box" style="display: none"></div>
                            </div>

                            <div class="b-clear-float"></div>
                        </div>


                        <div class="qy-comment-title article-pl" style="border-bottom: 2px solid #007bf5;">
                            <ul id="new-pl" class="pl-list">
                                <div class="title">全部评论</div>
                            </ul>
                        </div>
                        <div class=" b-user-comment">
                            <div class="comment-load" style="display: none;"><img src="/static/common/images/loader.gif" alt=""></div>
                            <div class="row b-user b-parent comm_list">
                                <ul class="list" id="ulcommentlist">
                                    <div class="empty-prompt-w">
                                        <span class="prompt-null-w">还没有评论，快来抢沙发吧！</span>

                                    </div>

                                </ul>
                            </div>
                            <div class="row">
                                <div class="">
                                    <div class="b-border"></div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="">
                                <div class="b-border"></div>
                            </div>
                        </div>
                        <div class="section-page-w"></div>
                        <div class="section-emoji"></div>
                    </div>


                </div>
            </div>.
            {/if}
        </div>
        <div class="right public">
            <div class="box">
                <div class="ad">

                    {:hooks('adplan.ad_show',['alias'=>'detail_right'])}


                </div>

                {include file="article/toprow" /}
                {if sysconfig('switch.comment')}
                {include file="article/comments" /}
                {/if}

            </div>
        </div>
    </div>
</div>


{/block}
{block name="js"}






<script type="text/javascript" src="__HOME__/js/poster.js"></script>
<script type="text/javascript" src="__COMMON__/js/ajax.js"></script>
{/block}
{block name="script"}

<script id="pl-template" data-id="{$item.article_id}" type="text/html">
    {{#layui.each(d, function(index, item){ }}
    <li class="layui-clear">
        <a  target="_blank" class="li-img">
            <img src="{{item.avatar}}" onerror="this.src='__STATIC__/common/images/avatars/default.png';"/>
        </a>
        <div class="li-info" data-id="{{item.id}}">
            <a  class="li-nick" target="_blank">{{item.nickname}}{{#if("c2db2e9c-3cc7-49a1-baa4-3c53d7e9fdd6"===item.uuid){}} <em style="background: #4bc4ff; margin-left: 8px; margin-right: -8px;">作者</em>{{#}else if(item.rank=="管理员" || item.rank=="金牌作者"){}}<em>{{item.rank}}</em> {{#}}}<i>{{getDateDiff(item.create_time)}}</i></a>
            <div class="li-content comm">{{item.content}}</div>
            {{#if(item.reply.length>0){}}
            <div class="zi-pl">
                <ul>
                    {{#  layui.each(item.reply, function(indexs, items){ }}
                    <li {{#if (indexs>1){}} hidden{{#} }}>
                        <div class="zi-pl-content">
                            <a href="" target="_blank" class="zi-nick">{{items.nickname}}</a>
                            {{#  layui.each(item.reply, function(idx, items_hf){ }}

                            {{#if(items.pid==items_hf.id){}}
                            回复 <a href="" target="_blank" class="zi-nick"> {{items_hf.nickname}} </a>
                            {{#}}}

                            {{#});}}
                            ：
                            {{items.content}}
                        </div>
                        <div class="zi-cz" data-id="{{items.id}}">
                            <a class="huifubtn">回复</a>
                            · {{getDateDiff(items.time)}}
                        </div>
                    </li>
                    {{#});}}
                </ul>
                {{#if( item.reply.length>2){}}
                <a href="javaScript:void(0)" class="zi-loadmore">查看更多回复</a>
                {{#}}}
            </div>
            {{#}}}
            <div class="li-go" data-id="{{item.id}}">
                <a class="huifubtn"><i class="iconfont icon-message"></i>回复</a>
                <a href="javaScript:void(0);" class="commentVote" data-type="support"  data-id="{{item.id}}" data-dz="{{item.support_num}}">
                    <i class="iconfont icon-dianzan"></i>顶 {{item.support_num}}</a>
                <a href="javaScript:void(0);" class="commentVote"  data-type="oppose"  data-id="{{item.id}}"  data-dz="{{item.oppose_num}}">
                    <i class="iconfont icon-dianzan"></i>踩 {{item.oppose_num}}</a>
            </div>
        </div>
    </li>
    {{#  }); }}

</script>
<script type="text/javascript" src="__HOME__/js/html.js"></script>
<script type="text/javascript" src="__COMMON__/js/jquery.fancybox.min.js"></script>
<script language="javascript" type="text/javascript">addView({$item.id});</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
{/block}